package cn.anc.aonicardv.module.ui.my;

import android.content.pm.PackageManager;
import android.os.Bundle;
import android.widget.TextView;

import androidx.annotation.Nullable;
import butterknife.BindView;
import butterknife.OnClick;
import cn.anc.aonicardv.R;
import cn.anc.aonicardv.R2;
import cn.anc.aonicardv.module.ui.base.BaseActivity;
import cn.anc.aonicardv.util.ActivityUtils;
import cn.anc.aonicardv.util.NetUtils;
import cn.anc.aonicardv.util.WiFiUtil;

/**
 * Created by yangdai on 2017/6/22.
 */

public class AboutActivity extends BaseActivity {

    @BindView(R2.id.tv_title)
    TextView titleTv;
    @BindView(R2.id.tv_version)
    TextView versionTv;


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        setContentView(R.layout.activity_about);
        super.onCreate(savedInstanceState);
    }

    @Override
    public void initVariable() {
    }

    @Override
    public void setListener() {

    }


    @Override
    public void initData() {
        titleTv.setText(getString(R.string.my_about));
        try {
            versionTv.setText("V " + getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }
    }

    @OnClick(R2.id.tv_back)
    public void back() {
        finish();
    }

    @OnClick(R2.id.rl_enter_web_site)
    public void enterWebSite() {
        if (NetUtils.isConnectedDevices(this)) {
                WiFiUtil.getInstance(this).closeWifi();
        }
        ActivityUtils.jumpActivity(this, WebSiteActivity.class);
    }


    @OnClick(R2.id.rl_enter_privacy)
    public void enterPrivacy() {
        ActivityUtils.jumpActivity(this, PrivacyDetailActivity.class);
    }
}
